<layout name="Layout/layout" />

<div id="wrapper">
    <div class="col-md-2">
        <include file="Layout:left-menubar" />
    </div>
    <div class="col-md-10">
        <!-- Page Content -->
        <div id="page-content-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1>修改密码</h1>
                        <form action="{:U('Index/changepasswdHandle')}" method="post">
							<div class="form-group">
								<label for="password">旧密码</label>
								<input name="oldpassword" type="password" class="form-control" id="password" placeholder="旧密码">
							</div>
                            <div class="form-group">
								<label for="password">新密码</label>
								<input name="newpassword" type="password" class="form-control" id="password" placeholder="新密码">
							</div>
                            <div class="form-group">
								<label for="password">重复新密码</label>
								<input name="repassword" type="password" class="form-control" id="password" placeholder="重复新密码">
							</div>
							<button type="submit" class="btn btn-default btn-submit">提交</button>
                            <a id="reset" href="#">忘记旧密码请联系工作人员重置密码</a>
						</form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /#page-content-wrapper -->
    <!-- Modal -->
    <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myModalLabel">请联系工作人员重置密码</h4>
          </div>
          <div class="modal-body">
              <p>
                  电话：<a href="tel:99999999">99999999</a>
              </p>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          </div>
        </div>
      </div>
    </div>
</div>
<!-- /#wrapper -->
<script>
    window.onload = function(){
        $('#reset').click(function(){
            $('#confirmModal').modal();
        });
        $('.btn-submit').click(function(){
            if($('input[name=newpassword]').val().length <= 6){
                alert('密码长度过短');
                return false;
            }
            if($('input[name=newpassword]').val() == $('input[name=repassword]').val()){
                alert('两次输入的密码不一致');
                return false;
            }
            return true;
        });
    }
</script>
